package com.study.provider.service.impl;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author anner
 * @description: TODO
 * @date 2021/4/18 23:09
 */
public class JavaPoolManageImpl {

    /**
     * java线程池有哪些参数
     */
    public void poolTestDemo() {
        int corePoolSize = 5;
        int maximumPoolSize = 10;
        long keepAliveTime = 10;
        TimeUnit unit = TimeUnit.SECONDS;
        BlockingQueue<Runnable> workQueue =new ArrayBlockingQueue<Runnable>(1);
        ThreadPoolExecutor demoExecutor = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
    }

}
